package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.cart.client.impl.CartFeignClientImpl;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(value = "service-cart",fallback = CartFeignClientImpl.class)
public interface CartFeignClient {

    //添加购物车
    @PostMapping("api/cart/addToCart/{skuId}/{skuNum}")
    public Result addToCart(@PathVariable Long skuId, @PathVariable int skuNum);

    //订单列表确认购买商品列表
    @GetMapping("api/cart/getCartCheckedList/{userId}")
    public List<CartInfo> getCartCheckedList(@PathVariable String userId);

    //更新购物车商品最新价格")
    @GetMapping("api/cart/loadCartCache/{userId}")
    public Result loadCartCache(@PathVariable("userId")String userId);
}
